package com.neu.elm.controller;

import com.neu.elm.po.Business;
import com.neu.elm.service.BusinessService;
import com.neu.elm.service.impl.BusinessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:csw
 * @Date: 15:47 2020/9/15
 */
@RestController
@RequestMapping("/BusinessController")
public class businessController {

    @Autowired
    private BusinessService businessService;

    @RequestMapping("/listBusinessByOrderType")
    public List<Business> listBusinessByOrderTypeId(Business business)throws Exception{
        return businessService.listBusinessByOrderTypeId(business.getOrderTypeId());
        //return businessService.listBusinessByOrderTypeId(1);
    }

    @RequestMapping("/getBusinessById")
    public Business getBusinessById(Business business) throws Exception{
        return businessService.getBusinessById(business.getBusinessId());
        //return businessService.getBusinessById(10001);
    }
}
